popLayer={
				width:null,//设置宽度
				height:null,//设置高度
				shLeft:null,
				shTop:null,
				doWidth:null,
				doHeight:null,
		   		addLayer:function(){
					/*** 添加背景 */
					popbg={width:this.doWidth,height:this.doHeight,background:'#000',position:'absolute',
							left:'0',top:'0',opacity:'0.5','z-index':'2222'}
					$('<div/>').attr('id','popBg').css(popbg).prependTo('body');
					/***添加层**/
					popBordera={width:this.width,height:this.height,border:'0 solid #5e5e5e',
								position:'absolute',left:'0',top:'0','z-index':'3333'}
					$('<div/>').attr('id','popBordera').css(popBordera).prependTo('body');
					/**添加层背景和内容**/			
					popBorderTop={width:this.width,height:20,background:'url(image/top.png)'};
					popBorderBot={width:this.width,height:20,background:'url(image/bot.png)'};
					popCont={width:this.width,height:this.height,
								background:'url(image/mid.png) repeat-y','text-align':'center'};
					$('<div/>').css(popBorderTop).prependTo('#popBordera');
					$('<div/>').attr('id','popCont').css(popCont).appendTo('#popBordera');
					$('<div/>').css(popBorderBot).appendTo('#popBordera');
					/***添加关闭按钮***/
					popClose={width:'20px',height:'20px',position:'absolute',
								left:this.width-20,top:0,cursor:'pointer',
								background:'url(image/closeo.png) no-repeat','z-index':'3334'}	
			  		$('<div/>').attr({href:'#',title:'关闭',id:'popClose'})
								.css(popClose).prependTo('#popBordera');
					/***定位层***/
					popLayer.width=$('#popBordera').outerWidth();
					popLayer.height=$('#popBordera').outerHeight();
					lefts=this.shLeft-popLayer.width /2;
					tops=this.shTop - popLayer.height/2;
					tops=tops<0?0:tops;
					$('#popBordera').css({left:lefts,top:tops-20,opacity:0})
							.animate({top:'+=20',opacity:1},'slow');
					$(window).resize(function(){
						popLayer.doWidth=$(document).width();
						popLayer.doHeight=$(document).height();
		 				$('#popBg').css({width: popLayer.doWidth,height: popLayer.doHeight});
					});
		   	},
				closeLayer:function(){
				$('#popClose').click(function(){
				$('#popBordera').animate({top:'+=20',opacity:'hide'},'slow',function(){
					$('#popBordera').remove();
					$('#popBg').remove();
				})
					

					return false;
				});
			},
			
			setCont: function(cont){
				$(cont).appendTo('#popCont');
				
			},
			clearCont: function(){
				$('#popCont').html('');
			},
			closeCl:function(){
				$('#popClose').click();
			},
		    init:function(w,h){
				this.doWidth=$(document).width();//+$(document).scrollLeft();
				this.doHeight=$(document).height();//+$(document).scrollTop();
				this.shLeft=$(document).scrollLeft()+$(window).width()/2;
				this.shTop=$(document).scrollTop()+$(window).height()/2;
		   		this.width=w;
				this.height=h;
				this.addLayer();
				this.closeLayer();
		
		   }
}
/**
 * popLayer.init(400,300);
 * popLayer.setCont('<b>这个是测试的</b>');
 * popLayer.changeLayer(200,500);
 */
